#coding: utf-8

import re

__all__ = ['GODUSER', 'SUPERUSERS', 'GroupRepeatProb', 'KeywordsRepeatProb',
    'HelpMsg', 'MatchAt', 'getAtList', '__plugin_name__', 'COMMANDS', 'SPECIAL_GROUP',
    'DEFAULT_GROUP_PROB', 'NEED_SAVE']

__plugin_name__ = "awesome.plugins.repeat"

NEED_SAVE = ['KeywordsRepeatProb', 'GroupRepeatProb', 'SUPERUSERS', 'SPECIAL_GROUP', 'DEFAULT_GROUP_PROB']
GODUSER = 269465508 # 超级管理
SUPERUSERS = { # 群管
    'all': set(), # 全局群管
}
GroupRepeatProb = {} # 群复读概率
DEFAULT_GROUP_PROB = 5
KeywordsRepeatProb = { # 关键词复读
    'all': { # 全局关键词复读, 假设存在冲突情况下优先选择当前群
        'abs': { # 完全匹配复读
        },
        'inc': { # 包含匹配复读
        }
    },
}
SPECIAL_GROUP = [
    584271740, # 骡德岛Nuist分部
]
HelpMsg = """复读模块帮助文档.
* environ   只有 'global' 和 'local' 两种选项
*  type     只有   'abs'  和  'inc'  两种选项
#setkey     [environ] [type] [str] [int]
#delkey     [environ] [type] [str]
#setadmin   [environ] [int]
#setgroup   [environ] [int]
#deladmin   [environ] [int]
#listkey    [environ]
#listadmin  [environ]
#listgroup  [environ]
#delallkey  [environ]
#setexcept
#delexcept"""
COMMANDS = ['setkey', 'delkey', 'setadmin', 'setgroup', 
    'deladmin', 'listkey', 'listadmin', 'listgroup', 'delallkey', 'setexcept', 'delexcept']
MatchAt = re.compile(r'qq=\d+')
getAtList = lambda x: [int(i[3:]) for i in MatchAt.findall(x)]